﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for UrlBuilder
/// </summary>
public class UrlBuilder
{
    public UrlBuilder()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    public static string location = "";
    public static string GetImage(string Url, int w, int h, bool c)
    {
        if (Url == "")
            Url = "/css/images/noimage.jpg";
        if (c)
            return location + string.Format("/img/w{0}h{1}{2}", w, h, Url);
        return location + string.Format("/img/w{0}h{1}{2}", w, h, Url);
    }
    public static string GetImage(string Url, int w, int h)
    {
        if (Url == "")
            Url = "/css/images/noimage.jpg";
        return location + string.Format("/img/w{0}h{1}{2}", w, h, Url);
    }
    public static string GetImage(string Url, int w)
    {
        if (Url == "")
            Url = "/css/images/noimage.jpg";
        return location + string.Format("/img/w{0}{1}", w, Url);
    }
    //public static string GetTourListUrl(string ParentTypeTextID, string TypeTextID)
    //{
    //    if (ParentTypeTextID != TypeTextID)
    //        return string.Format("/TourList.aspx?ParentTypeTextID={0}&TypeTextID={1}", ParentTypeTextID, TypeTextID);
    //    return string.Format("/TourList.aspx?TypeTextID={0}", TypeTextID);
    //}
    public static string GetTourListUrl(string TypeTextID)
    {

        //return string.Format("/Tourist/List.aspx?TypeTextID={0}", TypeTextID);
        return string.Format("/tour/{0}.html", TypeTextID);
    }
    public static string GetTourListDetailUrl(string TypeTextID)
    {
        //return string.Format("/Tourist/List.aspx?TypeTextID={0}", TypeTextID);
        return string.Format("/tour/{0}.html", TypeTextID);
    }
    public static string GetTourListPagingUrl(string TypeTextID)
    {
        //return string.Format("/TourList.aspx?TypeTextID={0}", TypeTextID) + "&page={0}";
        return string.Format("/tour/{0}", TypeTextID) + "/trang-{0}.html";
    }
    //------------
    public static string GetEventDatailUrl(string EventTextID)
    {

        return string.Format("/EventDetail.aspx?EventTextID={0}", EventTextID);
    }
    public static string GetEventDatailPagingUrl(string EventTextID)
    {
        return string.Format("/EventDetail.aspx?EventTextID={0}", EventTextID) + "&page={0}";
    }
    //---------------PHAN TRANG
    public static string GetEventListPagingUrl(string EventTypeTextID)
    {
        return string.Format("/Tourist/EventList.aspx?EventTypeTextID={0}", EventTypeTextID) + "&page={0}";
    }
    public static string GetConfigDatailPagingUrl(string ConfigTextId)
    {
        return string.Format("/Introduction.aspx?ConfigTextId={0}", ConfigTextId) + "&page={0}";
        return string.Format("/Intro.aspx?ConfigTextId={0}", ConfigTextId) + "&page={0}";
    }
}